﻿#region Copyright information
// 
// Copyright © 2005-2013 Yongkee Cho. All rights reserved.
// 
// This code is a part of the Biological Object Library and governed under the terms of the
// GNU Lesser General  Public License (LGPL) version 2.1 which accompanies this distribution.
// For more information on the LGPL, please visit http://bol.codeplex.com/license.
// 
// - Filename: Economy.cs
// - Author: Yongkee Cho
// - Email: yongkeecho@gmail.com
// - Date Created: 2013-01-24 4:34 PM
// - Last Modified: 2013-01-25 3:59 PM
// 
#endregion
using System.Collections.Generic;
using BOL.Maths.Distributions;

namespace BOL.Algorithms.StateMachines.Models
{
    public enum EconomyStates { BullMarket, BearMarket, Recession }

    /// <summary>
    /// Models an espresso machine.
    /// </summary>
    public class Economy : MarkovChain<EconomyStates>
    {
        public Economy()
            : base(
                new [] { EconomyStates.BullMarket, EconomyStates.BearMarket, EconomyStates.Recession },
                new Dictionary<EconomyStates, IDistribution<EconomyStates>>
                {
                    { EconomyStates.BullMarket, new CategoricalDistribution<EconomyStates>(new Dictionary<EconomyStates, double> { { EconomyStates.BullMarket, 0.9 }, { EconomyStates.BearMarket, 0.075 }, { EconomyStates.Recession, 0.25 } }) },
                    { EconomyStates.BearMarket, new CategoricalDistribution<EconomyStates>(new Dictionary<EconomyStates, double> { { EconomyStates.BullMarket, 0.15 }, { EconomyStates.BearMarket, 0.8}, { EconomyStates.Recession, 0.05 } }) },
                    { EconomyStates.Recession, new CategoricalDistribution<EconomyStates>(new Dictionary<EconomyStates, double> { { EconomyStates.BullMarket, 0.25 }, { EconomyStates.BearMarket, 0.25 }, { EconomyStates.Recession, 0.5 } }) }
                }
            )
        {
        }
    }
}